package algo_annotations.trt;

import algo_annotations.heuristique.TraitementSousGroupe;
import commons.utils.UtilsCalcul;

public class DialogDetailsTraitement extends javax.swing.JDialog {

	public DialogDetailsTraitement() {
		initComponents();
	}

	public void initDisplay(TraitementSousGroupe trt) {
		pb_TraitementSousGroupe.setValue(0);
		tf_CurrentTraitement.setText(trt.sgs.toString());
		tf_NbAnnoGroupe.setText(""+trt.sgs.size());
		tf_TailleVivier.setText(""+trt.tailleVivier);
		tf_NbIter.setText(""+trt.nbIter);
	}

	public void updateDisplay(TraitementSousGroupe trt) {
		tf_NumIterCourante.setText(""+trt.numIter);
		tf_NoteCouranteSsGroupe.setText(""+trt.currentNote);
		pb_TraitementSousGroupe.setValue((int) UtilsCalcul.round((double)trt.numIter / trt.nbIter * 100,0));
	}


    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jLabel8 = new javax.swing.JLabel();
        tf_CurrentTraitement = new javax.swing.JTextField();
        tf_NoteCouranteSsGroupe = new javax.swing.JTextField();
        jLabel11 = new javax.swing.JLabel();
        jLabel14 = new javax.swing.JLabel();
        jLabel17 = new javax.swing.JLabel();
        tf_NumIterCourante = new javax.swing.JTextField();
        jLabel13 = new javax.swing.JLabel();
        tf_NbIter = new javax.swing.JTextField();
        tf_TailleVivier = new javax.swing.JTextField();
        tf_NbAnnoGroupe = new javax.swing.JTextField();
        pb_TraitementSousGroupe = new javax.swing.JProgressBar();
        jLabel7 = new javax.swing.JLabel();
        jLabel12 = new javax.swing.JLabel();

        setTitle("Détails du Traitement de la passe courante");
        setUndecorated(true);

        jLabel8.setFont(new java.awt.Font("Trebuchet MS", 0, 11));
        jLabel8.setText("- Taille vivier :");

        tf_CurrentTraitement.setEditable(false);
        tf_CurrentTraitement.setFont(new java.awt.Font("Trebuchet MS", 0, 11)); // NOI18N
        tf_CurrentTraitement.setBorder(javax.swing.BorderFactory.createEtchedBorder());

        tf_NoteCouranteSsGroupe.setEditable(false);
        tf_NoteCouranteSsGroupe.setFont(new java.awt.Font("Trebuchet MS", 0, 11));
        tf_NoteCouranteSsGroupe.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));

        jLabel11.setFont(new java.awt.Font("Trebuchet MS", 0, 11));
        jLabel11.setText("- Num itération :");

        jLabel14.setFont(new java.awt.Font("Trebuchet MS", 0, 11)); // NOI18N
        jLabel14.setText("/");

        jLabel17.setFont(new java.awt.Font("Trebuchet MS", 0, 11));
        jLabel17.setText("Avancement du sous-groupe courant :");

        tf_NumIterCourante.setEditable(false);
        tf_NumIterCourante.setFont(new java.awt.Font("Trebuchet MS", 0, 11));
        tf_NumIterCourante.setHorizontalAlignment(javax.swing.JTextField.RIGHT);
        tf_NumIterCourante.setBorder(null);

        jLabel13.setFont(new java.awt.Font("Trebuchet MS", 0, 11));
        jLabel13.setText("- Nb. anno grp :");

        tf_NbIter.setEditable(false);
        tf_NbIter.setFont(new java.awt.Font("Trebuchet MS", 0, 11));
        tf_NbIter.setBorder(null);

        tf_TailleVivier.setEditable(false);
        tf_TailleVivier.setFont(new java.awt.Font("Trebuchet MS", 0, 11));
        tf_TailleVivier.setBorder(null);

        tf_NbAnnoGroupe.setEditable(false);
        tf_NbAnnoGroupe.setFont(new java.awt.Font("Trebuchet MS", 0, 11));
        tf_NbAnnoGroupe.setBorder(null);

        pb_TraitementSousGroupe.setRequestFocusEnabled(false);
        pb_TraitementSousGroupe.setStringPainted(true);

        jLabel7.setFont(new java.awt.Font("Trebuchet MS", 0, 11));
        jLabel7.setText("Sous-groupe courant :");

        jLabel12.setFont(new java.awt.Font("Trebuchet MS", 0, 11));
        jLabel12.setText("- Note courante :");

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(layout.createSequentialGroup()
                        .addComponent(jLabel13)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(tf_NbAnnoGroupe, javax.swing.GroupLayout.DEFAULT_SIZE, 580, Short.MAX_VALUE))
                    .addGroup(layout.createSequentialGroup()
                        .addComponent(jLabel12)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(tf_NoteCouranteSsGroupe, javax.swing.GroupLayout.PREFERRED_SIZE, 89, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(layout.createSequentialGroup()
                        .addComponent(jLabel11)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(tf_NumIterCourante, javax.swing.GroupLayout.PREFERRED_SIZE, 31, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jLabel14, javax.swing.GroupLayout.PREFERRED_SIZE, 6, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(tf_NbIter, javax.swing.GroupLayout.PREFERRED_SIZE, 39, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(layout.createSequentialGroup()
                        .addComponent(jLabel8)
                        .addGap(20, 20, 20)
                        .addComponent(tf_TailleVivier, javax.swing.GroupLayout.PREFERRED_SIZE, 124, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
                        .addGroup(javax.swing.GroupLayout.Alignment.LEADING, layout.createSequentialGroup()
                            .addComponent(jLabel17)
                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                            .addComponent(pb_TraitementSousGroupe, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                        .addGroup(javax.swing.GroupLayout.Alignment.LEADING, layout.createSequentialGroup()
                            .addComponent(jLabel7)
                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                            .addComponent(tf_CurrentTraitement, javax.swing.GroupLayout.PREFERRED_SIZE, 344, javax.swing.GroupLayout.PREFERRED_SIZE))))
                .addContainerGap())
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel7)
                    .addComponent(tf_CurrentTraitement, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel17)
                    .addComponent(pb_TraitementSousGroupe, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel13)
                    .addComponent(tf_NbAnnoGroupe, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel8)
                    .addComponent(tf_TailleVivier, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel11)
                    .addComponent(tf_NumIterCourante, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel14)
                    .addComponent(tf_NbIter, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel12)
                    .addComponent(tf_NoteCouranteSsGroupe, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents



    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JLabel jLabel11;
    private javax.swing.JLabel jLabel12;
    private javax.swing.JLabel jLabel13;
    private javax.swing.JLabel jLabel14;
    private javax.swing.JLabel jLabel17;
    private javax.swing.JLabel jLabel7;
    private javax.swing.JLabel jLabel8;
    private javax.swing.JProgressBar pb_TraitementSousGroupe;
    private javax.swing.JTextField tf_CurrentTraitement;
    private javax.swing.JTextField tf_NbAnnoGroupe;
    private javax.swing.JTextField tf_NbIter;
    private javax.swing.JTextField tf_NoteCouranteSsGroupe;
    private javax.swing.JTextField tf_NumIterCourante;
    private javax.swing.JTextField tf_TailleVivier;
    // End of variables declaration//GEN-END:variables


}

